<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <script>
    const obj = {
      name: "zs",
      sayHi() {
        console.log('sayHi this  ----->  ', this);
      },
      sayHello: () => {
        console.log('sayHello this  ----->  ', this);
      }
    };

    // this指向口诀
    // 口诀1： 💥💥普通函数，谁调用指向谁，找.前面的
    obj.sayHi()  // obj

    // 口诀2： 💥💥箭头函数没有this，自动绑定到作用域中的this
    obj.sayHello() // window

  </script>

</body>

</html>